package com.example.sync.controller;

import cn.hutool.core.util.IdUtil;
import com.example.sync.constant.Constant;
import com.example.sync.handler.impl.SysSmsHandler;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author chentao
 * @version 1.0
 * @description: TODO
 * @date 2025/3/22 下午3:27
 */
@RestController
public class SysSmsController {

    @Resource
    private SysSmsHandler sysSmsHandler;

    @RequestMapping(value = "sendSms")
    public Long sendSms() throws Exception {
        long nextId = IdUtil.getSnowflakeNextId();
        return sysSmsHandler.publish("com.example.user.SysUser", nextId, "user.add.sms.notify", Constant.JSON, nextId);
    }
}
